package com.chaodroid.flyui.view.text;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;

import com.chaodroid.flyui.R;

/**
 * Created by CHEN on 2017/12/12.
 * 带清除输入和搜索图标的输入框
 */

public class SearchEditView extends ClearEditView {

    private Drawable clearDrawable, searchDrawable;

    public SearchEditView(Context context) {
        this(context, null);
    }

    public SearchEditView(Context context, AttributeSet attrs) {
        super(context, attrs);
        //父类中有默认样式设置
        init();
    }

    public SearchEditView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init() {
        mDrawableLeft = getResources().getDrawable(R.drawable.search);
        setCompoundDrawablesWithIntrinsicBounds(mDrawableLeft, mDrawableTop, mDrawableRight, mDrawableBottom);
    }
}
